package com.example.smartwaterapi.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 饮水成就定义实体类
 */
@Data
@TableName(value = "water_achievements", autoResultMap = true)
public class WaterAchievement implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 成就ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 成就代码
     */
    private String achievementCode;

    /**
     * 成就名称
     */
    private String name;

    /**
     * 成就描述
     */
    private String description;

    /**
     * 成就图标
     */
    private String icon;

    /**
     * 徽章图片
     */
    private String badgeImage;

    /**
     * 类型：streak,volume,frequency,consistency,habit,special
     */
    private String type;

    /**
     * 条件类型：daily,weekly,monthly,total,continuous
     */
    private String conditionType;

    /**
     * 达成条件数值
     */
    private Integer conditionValue;

    /**
     * 条件单位：ml,days,times,percent
     */
    private String conditionUnit;

    /**
     * 复杂条件配置
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Object conditionConfig;

    /**
     * 奖励积分
     */
    private Integer rewardPoints;

    /**
     * 奖励称号
     */
    private String rewardTitle;

    /**
     * 奖励物品
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Object rewardItems;

    /**
     * 难度等级 1-5
     */
    private Integer difficulty;

    /**
     * 是否可重复获得
     */
    private Integer isRepeatable;

    /**
     * 是否隐藏成就
     */
    private Integer isHidden;

    /**
     * 解锁条件
     */
    private String unlockCondition;

    /**
     * 是否有效
     */
    private Integer isActive;

    /**
     * 排序
     */
    private Integer sortOrder;

    /**
     * 创建时间
     */
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    private LocalDateTime updatedAt;
} 